cmake_minimum_required(VERSION 3.31)
project(ChangeEnvVar  CXX)

# 设置 C++ 标准（根据需要调整）
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dist )
set(CMAKE_BUILD_TYPE Release)
# 添加编译选项：优化级别 O3
add_compile_options(-O3)

# 可执行文件名称和源文件
add_executable(ChangeEnvVar ChangeEnvVar.cpp ChangeEnvVar_ICO.o MyProject4.h MyProject4.cpp)

# 设置 Windows GUI 子系统（不显示控制台窗口）
set_target_properties(ChangeEnvVar PROPERTIES LINK_FLAGS "-mwindows")

# 添加包含目录
include_directories(
    G:/CPP_LIBRARY/wxWidgets/include
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/mswu
)

# 添加库搜索路径
link_directories(G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib)

# 强制静态链接指定的 wxWidgets 库
target_link_libraries(ChangeEnvVar PRIVATE
    -Wl,-Bstatic
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxexpat.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxjpeg.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxmsw32u.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxpng.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxregexu.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxscintilla.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxtiff.a
    G:/CPP_LIBRARY/wxWidgets/lib/gcc_x64_lib/libwxzlib.a
    -Wl,-Bdynamic
    rpcrt4 oleaut32 ole32 uuid uxtheme winspool winmm shell32 shlwapi comctl32 comdlg32 advapi32 version ws2_32 gdi32 oleacc winhttp
)